<?php
namespace app\common\model;
use think\Cache;

class Activity extends Common
{
	public static function getBusinessTime($begintime,$endtime)
    {
        $begintime = model('BusinessTime')->where('id',$begintime)->find();
        $endtime = model('BusinessTime')->where('id',$endtime)->find();
        $business_time = $begintime['name'].'-'.$endtime['name'];
        return $business_time;
    }

    public static function getBeginTime($begintime)
    {
        $begintime = model('BusinessTime')->where('id',$begintime)->find();
        return $begintime['name'];
    }

    public static function getEndTime($endtime)
    {
        $endtime = model('BusinessTime')->where('id',$endtime)->find();
        return $endtime['name'];
    }

    public static function getExtraService($value)
    {
        $valueArr = explode(',', $value);
        $list = ['1' => '酒水饮料','2' => '茶点小吃','3' => '餐饮','5' => '投影仪','6' => '音响设备','7' => '白板'];
        $extraService = implode(',', array_intersect_key($list, array_flip($valueArr)));
        return $extraService;
    }

    public static function getCategory($value)
    {        
        $list = model('ActivityCat')->column('id,name');
        return isset($list[$value]) ? $list[$value] : '';
    }

    public static function getParkNumber($value)
    {   
        $list = ['0' => '0-50','1' => '50-100','2' => '100-200','3' => '200-500','4'=>'500-1000'];
        return isset($list[$value]) ? $list[$value] : '';
    }

    public static function getAcCategoryAbbr($value)
    {
        //1=艺术沙龙,2=禅修,3= 私董会,5=游学,6=户外活动,7=人文美学,8= 个人管理,9= 战略创新,10=营销创新,11= 认知革命,12=创新思维
        $list = ['1' => '艺','2' => '禅','3' => '私','4' => '游','5' => '户','6'=>'课'];
        return isset($list[$value]) ? $list[$value] : '';
    }

    public static function getCity($value)
    {
        $city = model('city')->where('id',$value)->find();
        return $city['name'];
    }

}